/**************************************************************************
 *  This file is part of QXmlEdit                                         *
 *  Copyright (C) 2015-2018 by Luca Bellonda and individual contributors  *
 *    as indicated in the AUTHORS file                                    *
 *  lbellonda _at_ gmail.com                                              *
 *                                                                        *
 * This library is free software; you can redistribute it and/or          *
 * modify it under the terms of the GNU Library General Public            *
 * License as published by the Free Software Foundation; either           *
 * version 2 of the License, or (at your option) any later version.       *
 *                                                                        *
 * This library is distributed in the hope that it will be useful,        *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of         *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      *
 * Library General Public License for more details.                       *
 *                                                                        *
 * You should have received a copy of the GNU Library General Public      *
 * License along with this library; if not, write to the                  *
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,       *
 * Boston, MA  02110-1301  USA                                            *
 **************************************************************************/

#ifndef TESTANNOTXSDANNOTATIONEDITPROVIDER_H
#define TESTANNOTXSDANNOTATIONEDITPROVIDER_H

#include "modules/xsd/xsdhelper.h"

class TestInfoAnnotEdit
{
    public:

    enum ETestCase {
        None,
        CancelNoData,
        ConfirmSimple,
        ConfirmSimpleData,
        InsertComplexNoDataCancel,
        InsertComplexNoDataInsert,
        InsertComplexDataCancel,
        InsertComplexDataConfirm,
        InsertMixDataConfirm
    };


    enum Ex {
        Add,
        Del,
        Mod,
    };

    QString lang; QString source; QString content;
    Ex type;
    int index ;
    bool isAppInfo;

    TestInfoAnnotEdit(const Ex newType, const int newIndex, const bool newAppInfo, QString newLang, QString newSource, QString newContent)
    {
        index = newIndex ;
        type = newType ;
        lang = newLang;
        source = newSource;
        content = newContent;
        isAppInfo = newAppInfo;
    }
    ~TestInfoAnnotEdit(){}

    XInfoBase*createModel();
};

class TestAnnotXSDAnnotationEditProvider : public XSDAnnotationEditProvider
{
public:

    TestInfoAnnotEdit::ETestCase testCase;
    QList<TestInfoAnnotEdit*> complexData;
    //--------------
    bool hasOpenedSimple;
    bool hasOpenedComplex;
    TestAnnotXSDAnnotationEditProvider();
    ~TestAnnotXSDAnnotationEditProvider();

    XSDAnnotationEditor *newEditor(QWidget *window) ;
    void autoDelete();
};

#endif // TESTANNOTXSDANNOTATIONEDITPROVIDER_H
